import {request} from '../request';

const requestDeptPre = "/system/dept";

export function getDeptTableTree(roleId) {
	return request.get(
		requestDeptPre + "/getDeptTableTree"
	);
}


export function saveOrUpdateDept(data,state) {
	if (state==='add'){
		return saveDept(data);
	}
	return request.post(
		requestDeptPre + "/update",
		data
	);
}

export function saveDept(data) {
	return request.post(
		requestDeptPre + "/save",
		data
	);
}

export function deleteDept(deptId) {
	return request.delete(
		requestDeptPre + "/delete/"+deptId,
	);
}


